using System.ComponentModel;

namespace SumerCoreDevOps.Application.Dtos.Requests.Pipelines
{
    /// <summary>
    /// 创建流水线请求
    /// </summary>
    public class CreatePipelineRequest
    {
        /// <summary>
        /// 流水线名称
        /// </summary>
        /// <example>My Java Pipeline</example>
        [Description("流水线名称")]
        public string Name { get; set; } = null!;

        /// <summary>
        /// 关联的工作流定义ID
        /// </summary>
        /// <example>1</example>
        [Description("关联的工作流定义ID")]
        public long WorkflowDefinitionId { get; set; }

        /// <summary>
        /// Git 仓库 URL
        /// </summary>
        /// <example>https://github.com/user/repo.git</example>
        [Description("Git 仓库 URL")]
        public string RepositoryUrl { get; set; } = null!;

        /// <summary>
        /// Git 分支名称，默认为 main
        /// </summary>
        /// <example>main</example>
        [Description("Git 分支名称")]
        public string? Branch { get; set; }
    }

    /// <summary>
    /// 执行流水线请求
    /// </summary>
    public class ExecutePipelineRequest
    {
        /// <summary>
        /// Git commit 哈希值（可选）
        /// </summary>
        /// <example>abc123def456</example>
        [Description("Git commit 哈希值")]
        public string? CommitHash { get; set; }

        /// <summary>
        /// Git commit 消息（可选）
        /// </summary>
        /// <example>feat: new feature</example>
        [Description("Git commit 消息")]
        public string? CommitMessage { get; set; }
    }
}
